#!/usr/bin/env python
# -*- coding: utf-8 -*-

from distutils.core import setup
import py2exe
import shutil
import os
import sys
import glob

shutil.rmtree("build", ignore_errors=True)
shutil.rmtree("dist", ignore_errors=True)

version = "2.0"

sys.argv.append("py2exe") #Avoids having to use the command line
sys.argv.append("-q") #silent mode
sys.path.append(".")

setup(
    #Define the executable....
    windows = [
                {
                    "script": "interface_builder.py",
                    "name": "droidmidipad interface builder",
                    "version":version,
                    "description":"custom interface builder for droidmidipad",
                }
                ], 
    #Optional stuff - the following bundles data files with the executable - edit as required
    data_files = [
                (".", ["README.TXT"]),  #copy of the images -> into the images folder
        ],
    options = {"py2exe":{"excludes" : ['_gtkagg', '_tkagg', 'bsddb', 'curses', 'email', 'pywin.debugger',
                                    'pywin.debugger.dbgcon', 'pywin.dialogs', 'tcl',
                                    'Tkconstants', 'Tkinter'],
                        "dll_excludes": ['libgdk-win32-2.0-0.dll', 'libgobject-2.0-0.dll', 'tcl84.dll',
                                    'tk84.dll'],
                        "bundle_files": 1,
                        "compressed": 2,
                        "optimize": 2,
                        }
                },
    zipfile = None,
    )

print "removing build directory..."
# Remove the build directory
shutil.rmtree("build", ignore_errors=True)
print "FIN"